<template>
  <div class="announcement-box">
    <div class="announcement-card" v-for="(item, index) in articleList" :key="index">
      <span class="card-title">{{ item.content }}</span>
      <span class="card-time">{{ item.add_time }}</span>
    </div>
  </div>
</template>
<script setup>
import {ref, onMounted} from "vue";
import req from "@/libs/req";

const articleList = ref([]); // 公告列表

// 获取质押公告
const getArticle = async () => {
  const res = await req.post('Pledge/article');
  articleList.value = res;
}

onMounted(() => {
  getArticle();
})
</script>
<style scoped lang="scss">
.announcement-box {
  min-height: 100vh;
  .announcement-card {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #595959;
    padding: 20px 0;
    margin: 0 15px;
    .card-title {
      font-size: 14px;
      color: #F6F6F6;
    }
    .card-time {
      font-size: 11px;
      color: #F6F6F6;
      margin-top: 12px;
    }
  }
}
</style>